Processors, including microprocessors, digital signal processors and microcontrollers, operate by running software programs that are embodied in one or more series of program instructions stored in a memory. The processors run the software by fetching the program instructions from the series of program instructions, decoding the program instructions and executing them. In addition to program instructions, data is also stored in memory that is accessible by the processor. Generally, the program instructions process data by accessing data in memory, modifying the data and storing the modified data into memory.
Processors may be programmed to perform a wide variety of functions in software. In some cases, however, dedicated hardware may be included in a processor that significantly eases the processing load needed to perform certain functions. This allows the use of lower performance processor for these functions, which lowers the cost of the processor. One type of dedicated hardware that may advantageously be included in a processor is power control hardware. Power control hardware provides the capability to control circuitry and devices that use significant amounts of power. For example, power control hardware may be used to control motors, power supplies, etc.
One common mode of operation of power control hardware is pulse width modulation (PWM). In PWM, the power level is controlled by controlling the duty cycle of a signal that has only two states—active and inactive. The signal is then connected to output transistors and a load, such as a motor, to yield the equivalent of a continuously varying voltage and current.
When PWM hardware is included in a processor, external switching devices, such as transistors, must be used in order to handle significant amounts of power. These switching devices have less than perfect switching characteristics, especially when connected to devices such as motors. Problems arise with conventional PWM hardware, which has been included in current processors, in dealing with the less than perfect switching characteristics of connected switching devices.
When processors including PWM hardware drive externals devices, care must be taken to ensure that the external devices are driven to proper values at all times. This is done to avoid indeterminate states being applied to the external devices, the application of which would cause high power dissipation in and possibly damage to external devices.
In order to overcome these problems, conventional processors incorporating PWM hardware have incorporated tri-state output buffers. The tri-state output buffers cause the PWM outputs to “float” or not produce an output voltage in a tri-state mode. The tri-state mode is entered whenever the PWM module is inactive. Conventional systems also incorporate helping devices, such as resistors, which tie the PWM output pins to a termination voltage (generally either power or ground) according to the requirements of the system. The helping devices are active while the PWM output pins are tri-stated to avoid indeterminate states being applied to the external devices. The helping devices may also be weak enough that they remain active while the PWM outputs are active. In this scenario, the PWM outputs overcome the helping devices in applying output signals to the external devices in an active PWM mode.
While the conventional approach of incorporating external helping devices, such as resistors, works, it requires additional hardware, additional space on printed circuit boards to accommodate the devices and may increase the cost to implement. Moreover, conventional approaches may not permit simple system re-configuration.
Accordingly, there is a need for a new system and method for ensuring that determinate states are applied via PWM outputs under inactive conditions of the PWM module to external devices. There is a further need for a flexible approach to solving the problem that does not require resistors or devices external to the processor.